package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author shkstart
 * @create 2020-08-02 17:52
 */
public interface IUserDao {

    /*
    * 查询用户列表
    * */
    @Select("select * from User")
    public List<User> findAll();


    /*
    * 根据ID查询用户
    * */
    @Select("select * from user where id=#{id}")
    public User findById(Integer id);


    /*
    * 更新用户
    * */
    @Update("update user set username=#{username},password=#{password},age=#{age},sex=#{sex},email=#{email} where id=#{id}")
    public void updateUser(User user);


}
